param N;
param p {i in 1..N};
param w {i in 1..N};
param c;
param K;

var x {i in 1..N} >= 0;
var b {i in 1..N} >= 0, integer;

s.t. ogr_1 { i in 1..N}:
	x[i] <= b[i];

s.t. binar { i in 1..N}:
	b[i] <= 1;

s.t. pojemnosc:
	sum { i in 1..N} x[i]*w[i] <= c;

s.t. liczba_elementow:
	sum {i in 1..N} b[i] <= K;

maximize z:
	sum {i in 1..N} x[i]*p[i];

end;
